package edu.gatech.volt2.drdoommgt.domain;

import javax.persistence.Embeddable;


@Embeddable
public class Name{
	
	private String first;
	private String last;
	private String middle;
	
	
	public Name(){
		this.first = "";
		this.last = "";
		this.middle = "";

	}
	
	public Name(String firstName, String lastName){
		this();
		this.first = firstName;
		this.last = lastName;
	}
	
	public Name(String firstName, String middleName, String lastName){
		this();
		this.first = firstName;
		this.middle = middleName;
		this.last = lastName;
	}
	
	/**
	 * @return the first
	 */
	public String getFirst() {
		return first;
	}
	/**
	 * @param first the first to set
	 */
	public void setFirst(String first) {
		this.first = first;
	}
	/**
	 * @return the last
	 */
	public String getLast() {
		return last;
	}
	/**
	 * @param last the last to set
	 */
	public void setLast(String last) {
		this.last = last;
	}
	/**
	 * @return the middle
	 */
	public String getMiddle() {
		return middle;
	}
	/**
	 * @param middle the middle to set
	 */
	public void setMiddle(String middle) {
		this.middle = middle;
	}

	public String toString(){
		return first+(middle==null ? "":" " + middle)+" "+last;
	}
	
	public boolean equals(Name name2)
	{
		return (this.first.equals(name2.getFirst()) && this.middle.equals(name2.getMiddle()) && this.last.equals(name2.getLast()) );
	}
	
}
